<!DOCTYPE html>
<html>
<head>
	<meta name = "format-detection" content = "telephone=no">
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>{if empty($_Session['btitle'])}{$pagetitle}{else}{$_Session['btitle']}{/if}</title>
	<meta name="viewport" content="initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="{TG_URL_ARES}components/light/light7.min.css">
	<link rel="stylesheet" href="{TG_URL_ARES}components/weui/weui.css">
	<link rel="stylesheet" href="{TG_URL_ARES}components/icon/iconfont.css">
	<link rel="stylesheet" href="{TG_URL_ARES}css/aliicon/font.css?time=New Date()">
	<link rel="stylesheet" href="{TG_URL_ARES}css/common.css?time=15">
	<link href="{TG_URL_WRES}css/font-awesome.min.css" rel="stylesheet">
	{php echo register_jssdk();}
	<script src="{TG_URL_ARES}js/jquery-1.11.3.js"></script>

	<script type="text/javascript" src="{TG_URL_ARES}js/modify.js?time=New Date()"></script>
	<script type="text/javascript" src="{MODULE_URL}app/resource/layer/layer.js" ></script>
	<script type='text/javascript' src='{TG_URL_ARES}js/global.js' charset='utf-8'></script>
	<script type='text/javascript' src='{TG_URL_ARES}js/laytpl.js' charset='utf-8'></script>
	<script type='text/javascript' src='{TG_URL_ARES}components/light/light7.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='{TG_URL_ARES}components/swiper/swiper.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='{TG_URL_ARES}components/light/light7-city-picker.js' charset='utf-8'></script>
	<!-- 高德地图api -->
	<script src="//webapi.amap.com/maps?v=1.3&key=68cea1fa9bee514f9c9d6afcefb477b8&plugin=AMap.MouseTool"></script>
	<script type="text/javascript" src="//cache.amap.com/lbs/static/addToolbar.js"></script>
	<script>
        function escapeHtml(text) {
            var a=text.replace(/(\&lt;)/g,"<");
            var b=a.replace(/(\&gt;)/g,">");
            var c=b.replace(/(\&amp;)/g,"\&");
            var d=c.replace(/(\&quot;)/g,"\"");
            return d;
        }
	</script>
	<style>
		.preloader-indicator-overlay,.preloader-indicator-modal,.preloader-indicator-modal .preloader{
			display: none!important;
		}
	</style>
</head>

<body>

<div class="page-group">
    <div class="page page-current" id="page-coupon-get">
		<div class="content native-scroll app">
			<div class="app-coupon">
				<div class="promote-card">
					<div class="name clearfix">
						<span class="js-name"> {$coupon['name']} </span>
						<!--<a href="" class="promote-share">分享</a>-->
					</div>
					<div class="text-center promote-value">
						￥ <span class="js-value"> {if $coupon['is_random'] == 2} {$coupon['value']} ~ {$coupon['value_to']} {else} {$coupon['value']} {/if} </span>
					</div>
					<div class="text-center promote-limit js-is-at-least">
						{if !empty($coupon['at_least']) && $coupon['at_least'] != 0.00}
						订单满 <span class="js-at-least">  {$coupon['at_least']} </span>元 (不含运费)
						{else}
							不限制
						{/if}
					</div>
					<div class="text-center promote-time">
						有效日期：<span class="js-start-time"> {php echo date('Y-m-d H:i:s', $coupon['start_time']);} </span> - <span class="js-end-time"> {php echo date('Y-m-d H:i:s', $coupon['end_time']);} </span>
					</div>
					<div class="dot"></div>
				</div>
				<div class="promote-desc">
					<div class="promote-desc-title">使用说明</div>
					<div class="desc-detail js-description">
						{$coupon['description']} 										
					</div>
				</div>
				<div class="weui_btn_area">
		        	<div class="weui_btn weui_btn_primary" href="javascript:" id="getcoupon">领取优惠券</div>
		    	</div>
			</div>
		</div>
	</div>
</div>
<script>
	$(function() {
		'use strict';
		//编辑地址页
		$(document).on("pageInit", "#page-coupon-get", function(e, id, page) {
			var $content = $(page).find('.content');
			$content.on('click','#getcoupon',function () {				
				$.post("{php echo app_url('member/coupon/post',array('id'=>$id))}",{},function(d){
					if(d.status == 1){
						$.alert('优惠券领取成功', function () {
					        location.href = "{php echo app_url('member/coupon')}";
					    });
					}else{
						$.toast(d.result);
					}
				},"json");
		    });
		});
		$.init();
	});
</script>
<div id="footer">{php include wl_template('common/footer');}</div>
</body>

</html>